#include "dialog.h"
#include "ui_dialog.h"
#include <QDialog>
#include <QMessageBox>

Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui->setupUi(this);
}

Dialog::~Dialog()
{
    delete ui;
}


void Dialog::on_pushButton_clicked()
{
    if(ui->lineEdit->text().isEmpty() || ui->lineEdit_2->text().isEmpty())
    {
        QMessageBox::warning(this,"警告","请输入账号或密码");
        return;
    }
    //账号密码判断：
    if(ui->lineEdit->text() == "lifei" && ui->lineEdit_2->text() == "1234")
    {
        //登录成功
        rejected();
        //弹出一个新的窗口
        QDialog dlg;
        dlg.resize(700,500);
        dlg.exec();
    }
    else
    {
        QMessageBox::warning(this,"警告","账号或密码错误");
        return;
    }
}
